<template>
  <div id="app">
    <router-view v-if="isRouterAlive"></router-view>
  </div>
</template>

<script>
export default {
  name: 'App',
  provide(){
    return{
      reload:this.reload
    }
  },
  data(){
    return{
      isRouterAlive:true
    }
  },
  methods:{
    reload(){
      this.isRouterAlive=false
      this.$nextTick(function () {
        this.isRouterAlive=true
      })
    }
  },
  mounted(){
    window.onpopstate = () => {
      if(this.allowBack&&!this.allowBack){
        history.go(-1);
      }
    }
  }
}
</script>

<style>
#app {
  font-family: 'Avenir', Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-align: center;
  color: #2c3e50;
  margin-top: 60px;
}

.toolbar {
  background: #f2f2f2;
  padding: 10px;
  border:1px solid #dfe6ec;
  margin: 10px 0px;
}
.toolbar.el-form-item {
  margin-bottom: 10px;
}

.el-input__inner {
  cursor: pointer;
}
.icon-tips {
  font-size: 18px;
  text-align: center;
  color: #e6a23c;
  cursor: pointer;
}
</style>
